//
//  YsNetWorkManage.h
//  YsCloudFileManageSDK
//
//  Created by 宋宏康 on 2020/2/24.
//

#import <Foundation/Foundation.h>
#import "YsResultModel.h"

/** 成功回调 */
typedef void (^SuccessBlock) (YsResultModel *responseObject);
/** 失败回调 */
typedef void (^FailedBlock) (id error);

@interface YsNetWorkManage : NSObject

/// 1. 获取通道
/// @param uid 用户的平台uid
/// @param successfull 成功回调
/// @param failed 失败回调
+ (NSURLSessionDataTask *)uploadFetchWayWithuid:(NSString *)uid
                                        success:(void (^)(YsResultModel *result))successfull
                                           fail:(void (^)(NSError *error))failed;

/**
 秒传检测

 @param uid 用户的平台uid
 @param hash 文件hash值，注意必须使用sdk中的HashFile.js算法(文件指纹hash算法)生成
 @param fileName 文件名（必须有正确的文件扩展名）
 @param fileSize 文件大小，单位字节
 @param maxFileCount 文件文件切片数
 @param size 文件切片规格，一片切多大，单位字节，必须为1MB
 @param successfull 成功
 @param failed 失败
 @return NSURLSessionDataTask
 */
+ (NSURLSessionDataTask *)uploadcheckWithuid:(NSString *)uid
                                    Withhash:(NSString *)hash
                                     WitfileName:(NSString *)fileName
                                     WithfileSize:(long long)fileSize
                                     WithmaxFileCount:(NSInteger)maxFileCount
                                     Withsize:(NSInteger)size
                                        success:(void (^)(YsResultModel *result))successfull
                                        fail:(void (^)(NSError *error))failed;



/// 上传完成
/// @param uid 用户平台的uid
/// @param name 文件名字
/// @param size 文件大小
/// @param hash hash值
/// @param mime 文件mime类型
/// @param successfull 成功
/// @param failed 失败
+ (NSURLSessionDataTask *)uploadMoveFileWithuid:(NSString *)uid
                                       Withname:(NSString *)name
                                       Withsize:(NSInteger)size
                                       Withhash:(NSString *)hash
                                       Withmime:(NSString *)mime
                                        success:(void (^)(YsResultModel *result))successfull
                                          fail:(void (^)(NSError *error))failed;


@end

